-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFC] [MTE] add more tests for globals #113390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-backend-aarch64 Author: Florian Mayer (fmayer) ChangesFull diff: https://github.com/llvm/llvm-project/pull/113390.diff 1 Files Affected:
diff --git a/llvm/test/MC/AArch64/global-tagging.ll b/llvm/test/MC/AArch64/global-tagging.ll
index c8b3f52401dc11..75453e9bb62056 100644
--- a/llvm/test/MC/AArch64/global-tagging.ll
+++ b/llvm/test/MC/AArch64/global-tagging.ll
@@ -9,9 +9,12 @@
; RUN: llvm-mc -filetype=obj %t.S -triple=aarch64-linux-android31 -o %t.o
; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
-; RUN: obj2yaml %t.o -o %t.yaml
-; RUN: FileCheck %s --input-file=%t.yaml --check-prefix=CHECK-YAML
+; RUN: obj2yaml %t.o -o %t.o.yaml
+; RUN: FileCheck %s --input-file=%t.o.yaml --check-prefix=CHECK-OYAML
; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
+; RUN: ld.lld %t.o -o %t.so
+; RUN: obj2yaml %t.so -o %t.so.yaml
+; RUN: FileCheck %s --input-file=%t.so.yaml --check-prefix=CHECK-SOYAML
;; Check we don't create relocations referencing a section symbol for sanitize_memtag globals.
; CHECK-RELOCS: Relocation section '.rela.text' {{.*}} contains 4 entries:
@@ -27,19 +30,34 @@
; CHECK-RELOCS: R_AARCH64_NONE {{.*}} huge
; CHECK-RELOCS-NOT: specialcaselisted
-; CHECK-YAML: Sections:
-; CHECK-YAML: - Name: .rela.memtag.globals.static
-; CHECK-YAML-NOT: - Name:
-; CHECK-YAML: Relocations:
-; CHECK-YAML-NEXT: - Symbol: internal_four
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: four
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: sixteen
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: huge
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: -
+; CHECK-OYAML: Sections:
+; CHECK-OYAML: - Name: .rela.memtag.globals.static
+; CHECK-OYAML-NOT: - Name:
+; CHECK-OYAML: Relocations:
+; CHECK-OYAML-NEXT: - Symbol: internal_four
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: four
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: sixteen
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: huge
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: -
+
+;; Value: 0x{{.*}}0 checks for 16-alignment of address
+; CHECK-SOYAML: Symbols:
+; CHECK-SOYAML: - Name: internal_four
+; CHECK-SOYAML: Value: 0x{{.*}}0
+; CHECK-SOYAML: - Name: four
+; CHECK-SOYAML: Value: 0x{{.*}}0
+; CHECK-SOYAML: - Name: sixteen
+; CHECK-SOYAML: Value: 0x{{.*}}0
+; CHECK-SOYAML: - Name: huge
+; CHECK-SOYAML: Value: 0x{{.*}}0
+;; At least as currently laid out, specialcaselisted gets put adjacient to a
+;; tagged global, so it also has to be aligned to the next granule.
+; CHECK-SOYAML: - Name: specialcaselisted
+; CHECK-SOYAML: Value: 0x{{.*}}0
; CHECK-ASM: .memtag internal_four
; CHECK-ASM .p2align 4
|
@llvm/pr-subscribers-mc Author: Florian Mayer (fmayer) ChangesFull diff: https://github.com/llvm/llvm-project/pull/113390.diff 1 Files Affected:
diff --git a/llvm/test/MC/AArch64/global-tagging.ll b/llvm/test/MC/AArch64/global-tagging.ll
index c8b3f52401dc11..75453e9bb62056 100644
--- a/llvm/test/MC/AArch64/global-tagging.ll
+++ b/llvm/test/MC/AArch64/global-tagging.ll
@@ -9,9 +9,12 @@
; RUN: llvm-mc -filetype=obj %t.S -triple=aarch64-linux-android31 -o %t.o
; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
-; RUN: obj2yaml %t.o -o %t.yaml
-; RUN: FileCheck %s --input-file=%t.yaml --check-prefix=CHECK-YAML
+; RUN: obj2yaml %t.o -o %t.o.yaml
+; RUN: FileCheck %s --input-file=%t.o.yaml --check-prefix=CHECK-OYAML
; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
+; RUN: ld.lld %t.o -o %t.so
+; RUN: obj2yaml %t.so -o %t.so.yaml
+; RUN: FileCheck %s --input-file=%t.so.yaml --check-prefix=CHECK-SOYAML
;; Check we don't create relocations referencing a section symbol for sanitize_memtag globals.
; CHECK-RELOCS: Relocation section '.rela.text' {{.*}} contains 4 entries:
@@ -27,19 +30,34 @@
; CHECK-RELOCS: R_AARCH64_NONE {{.*}} huge
; CHECK-RELOCS-NOT: specialcaselisted
-; CHECK-YAML: Sections:
-; CHECK-YAML: - Name: .rela.memtag.globals.static
-; CHECK-YAML-NOT: - Name:
-; CHECK-YAML: Relocations:
-; CHECK-YAML-NEXT: - Symbol: internal_four
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: four
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: sixteen
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: huge
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: -
+; CHECK-OYAML: Sections:
+; CHECK-OYAML: - Name: .rela.memtag.globals.static
+; CHECK-OYAML-NOT: - Name:
+; CHECK-OYAML: Relocations:
+; CHECK-OYAML-NEXT: - Symbol: internal_four
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: four
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: sixteen
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: huge
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: -
+
+;; Value: 0x{{.*}}0 checks for 16-alignment of address
+; CHECK-SOYAML: Symbols:
+; CHECK-SOYAML: - Name: internal_four
+; CHECK-SOYAML: Value: 0x{{.*}}0
+; CHECK-SOYAML: - Name: four
+; CHECK-SOYAML: Value: 0x{{.*}}0
+; CHECK-SOYAML: - Name: sixteen
+; CHECK-SOYAML: Value: 0x{{.*}}0
+; CHECK-SOYAML: - Name: huge
+; CHECK-SOYAML: Value: 0x{{.*}}0
+;; At least as currently laid out, specialcaselisted gets put adjacient to a
+;; tagged global, so it also has to be aligned to the next granule.
+; CHECK-SOYAML: - Name: specialcaselisted
+; CHECK-SOYAML: Value: 0x{{.*}}0
; CHECK-ASM: .memtag internal_four
; CHECK-ASM .p2align 4
|
Created using spr 1.3.4 [skip ci]
; RUN: obj2yaml %t.o -o %t.o.yaml | ||
; RUN: FileCheck %s --input-file=%t.o.yaml --check-prefix=CHECK-OYAML | ||
; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS | ||
; RUN: ld.lld %t.o -o %t.so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think LLD is built as part of check-llvm
so I would expect this to fail unless a new-enough LLD happens to be on $PATH
. The new test probably needs to be added to LLD instead.
No description provided.